import { applyDecorators } from '@nestjs/common';
import { ApiHeader } from '@nestjs/swagger';

export function ApiTenantHeader() {
	const isDevelopment = process.env.NODE_ENV === 'development';
	return applyDecorators(
		ApiHeader({
			name: 'Tenant-Code',
			description: 'Tenant identifier required for multi-tenancy',
			required: true,
			schema: isDevelopment
				? {
						default: 'j5AJUctQk0hW5BHSasbH',
					}
				: undefined,
		})
	);
}
